var menuPanel = function(){
	return {
		getMenuPanel : function(){
		
			actServiceMenu = [];
			actServiceMenu.push({ id:'basicInfo',text: "基本信息维护", leaf: true });
			actServiceMenu.push({ id:'changePWD',text: "修改密码", leaf: true });
			actServiceMenu.push({ id:'mapInfo',text: "映射信息维护", leaf: true });
			actServiceMenu.push({ id:'identityApply',text: "身份注册申请", leaf: true });
			actServiceMenu.push({ id:'corpApply',text: "机构注册申请", leaf: true });
			
			corpRegistMenu = [];
			corpRegistMenu.push({ id:'organization',text: "组织机构", leaf: true });
			corpRegistMenu.push({ id:'post',text: "岗位信息", leaf: true });
			
			personManageMenu = [];
			personManageMenu.push({ id:'staff',text: "身份注册", leaf: true });
			personManageMenu.push({ id:'workGroup',text: "工作组成员", leaf: true });
			
			taskManageMenu = [];
			taskManageMenu.push({ id:'operaDef',text: "操作定义", leaf: true });
			taskManageMenu.push({ id:'taskDistribute',text: "任务调度", leaf: true });
			
			sysManageMenu = [];
			sysManageMenu.push({ id:'roleManage',text: "角色管理", leaf: true });
			sysManageMenu.push({ id:'auditManage',text: "审计管理", leaf: true });
			sysManageMenu.push({ id:'ssoManage',text: "单点登录管理", leaf: true });
			sysManageMenu.push({ id:'GUIDQuery',text: "对象GUID查询", leaf: true });
		
			var store = Ext.create('Ext.data.TreeStore', {
			    root: {
			        expanded: true, 
			        children: [
			            { text: "待办工作", expanded: true, leaf:true},
			            { text: "应用注册", id:'appRegister',expanded: true, leaf:true},
			            { text: "自助服务", expanded: true, children:actServiceMenu},
			            { text: "机构注册", expanded: true, children: corpRegistMenu},
			            { text: "人员管理", expanded: true, children: personManageMenu},
			            { text: "任务管理", expanded: true, children: taskManageMenu},
			            { text: "系统管理", expanded: true, children: sysManageMenu}
			        ]
			    }
			}); 
			
			var menupanel = Ext.create('Ext.tree.Panel', {
				id : 'menuPanel',
			    store: store,
			    border: false,
			    rootVisible: false
			});
			
			menupanel.on('itemclick', function(view,record,item,index,e,options){
				if(record.data.leaf){
					var centerPanel = Ext.getCmp('mainPanel');
					centerPanel.removeAll();
					var panelId = record.data.id;
					if(panelId == 'appRegister'){
						centerPanel.add(appRegisterPanel.getAppRegisterPanel());
					}else if(panelId == 'organization'){
						centerPanel.add(orgPanel.getOrgPanel());
					}else if(panelId == 'post'){
						centerPanel.add(postPanel.getPostPanel());
					}else if(panelId == 'staff'){
						centerPanel.add(staffPanel.getStaffPanel());
					}else if(panelId == 'feeCount2'){
						centerPanel.add(feeCount2Panel.getfeeCount2Panel());
					}else if(panelId == 'basicInfo'){
						centerPanel.add(staffPanel.getEditStaffPanel4Self('5'));
					}else if(panelId == 'changePWD'){
						centerPanel.add(staffPanel.getChangePWDWin('5'));
					}
				}
			});
			
			return menupanel;
		}
	};
}();